<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,width=device-width" />
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<title>评论回复</title>
<link rel="shortcut icon" type="image/ico" href="${basePath}/images/ico.ico?v=1"/>
<link href="${basePath}/css/phone/comment.css" rel="stylesheet"/>
</head>
<body class="bgf3">
<h3 class="articleT">${bean.title?default('')}</h3>
<form method="post" id="form" action="${basePath}/art/comment/save?id=${id!}&wxid=${wxid!}">
<input type="hidden" id="ajaxUrl" value="${basePath}">
<input type="hidden" id="error" value=${error!}>
<div class="addCommentTxt" style="width:90%; padding:1rem 5%; background-color:#fff; ">
	<textarea id= "comment" name="comment" placeholder="评论将提交后显示，对所有用户可见。字数不超过100" style="width:99%;height:120px;" maxlength="100"></textarea>
</div>
<input type="button" class="subBtn" value="提交"/>
</form>
<script type="text/javascript" src="${basePath}/js/bank/zepto.min.js"></script>
<script type="text/javascript" src="${basePath}/js/stem/stem.m.js"></script>
<script type="text/javascript" src="${basePath}/js/stem/alert.js"></script>
<script type="text/javascript">
$(function(){
	var error = $("#error").val();
	$(".subBtn").click(function(){
		if($(".addCommentTxt textarea").val()==""){
			$(".addCommentTxt").addClass("wrong");
			tip.info("请输入评论内容！");
			return false;
		}
		var ajaxUrl=$("#ajaxUrl").val();
		var comment=$("#comment").val();
  		$.ajax({	
  	  	   type: "POST",	 	   
  	  	   contentType: "application/json; charset=utf-8",
  	  	   url: ajaxUrl+"/art/comment/ajaxWords?comment="+comment,//?currentPage="+currentPage,
  	  	   dataType:"json",
  	  	   success: function(json){
  	  		   if(json==null || json.length == 0){
  	  			  $("#form").submit();
  	  			   return true;
  	  		   }else{
  	  			   tip.info(json);
  	  			   return false;
  	  		   }
  	  	   }
	  	})
	})
	 /*if(error != ""){
		alert(error);
		return false;
	 }*/
	$(".addCommentTxt textarea").focus(function(){
		$(".addCommentTxt").removeClass("wrong");
	})
})
</script>
</body>
</html>